package edu.bbu.commonproject.desktop.gui.view.swing.setup;

import java.awt.CardLayout;
import java.awt.Dimension;

import javax.swing.JPanel;

import edu.bbu.commonproject.desktop.gui.view.SetupInterface;
import edu.bbu.commonproject.desktop.gui.view.swing.setup.menus.PrivacySetupsPanel;
import edu.bbu.commonproject.desktop.gui.view.swing.setup.menus.SyncSetupsPanel;

/**
 * The Center setup colletion panel class.
 */
public class CenterSetupCollectionPanel extends JPanel
{
	/** It initialises the SYNC_SETUP_PANEL. */
	public static final String SYNC_SETUP_PANEL = SetupInterface.SYNC_SETUP_PANEL;
	
	/** It initialises the PRIVACY_SETUP_PANEL. */
	public static final String PRIVACY_SETUP_PANEL = SetupInterface.PRIVACY_SETUP_PANEL;
	
	/** The card layout. */
	private CardLayout cardLayout;
	
	/** The synchronized setup panel. */
	private SyncSetupsPanel syncSetupsPanel;
	
	/** The privacy setup panel. */
	private PrivacySetupsPanel privacySetupsPanel;
	
	/**
	 * The constructor.
	 */
	public CenterSetupCollectionPanel()
	{
		cardLayout = new CardLayout();
		
		this.setLayout(cardLayout);
		this.setPreferredSize(new Dimension(750, 500));
		this.setOpaque(false);
		
		setComponents();
	}	
	
	/**
	 * It sets up the components.
	 */
	private void setComponents()
	{
		syncSetupsPanel = new SyncSetupsPanel();
		privacySetupsPanel = new PrivacySetupsPanel();
		
		this.add(syncSetupsPanel, SYNC_SETUP_PANEL);
		this.add(privacySetupsPanel, PRIVACY_SETUP_PANEL);
	}
	
	/**
	 * It moves the panel to the front.
	 * @param panelName the panel name.
	 */
	public void moveToFront(String panelName)
	{
		cardLayout.show(this, panelName);
	}
	
	/**
	 * Gets the synchronized setup panel.
	 * @return the synchronized setup panel.
	 */
	public SyncSetupsPanel getSyncSetupsPanel()
	{
		return syncSetupsPanel;
	}
	
	/**
	 * Gets the privacy setup panel.
	 * @return the privacy setup panel.
	 */
	public PrivacySetupsPanel getPrivacySetupsPanel()
	{
		return privacySetupsPanel;
	}
}
